import React from 'react';
import { View, Text, Button,Image, StyleSheet, TouchableOpacity } from 'react-native';
import SearchHome from './../../components/business/SearchHome';

class HomeScreen extends React.Component {
    static navigationOptions = {
        title: 'Home'
    };

    _onSearchPress () {
        console.log('点击搜索');
    }

    _onHearPress () {
        console.log('查看阅读');
    }

    render() {
        return (
            <View style={homeStyles.container}>
                <View style={searchStyles.searchContainer}>
                    <TouchableOpacity style={searchStyles.searchContent} activeOpacity={1} onPress={this._onSearchPress}>
                        <View style={searchStyles.searchImageContent}>
                            <Image source={require('./../../assets/common/search.png')} style={searchStyles.searchImage} />
                        </View>
                        <Text style={searchStyles.placeText}>中央支持建设深圳先行示范区</Text>
                    </TouchableOpacity>
                    <TouchableOpacity style={searchStyles.searchHear} activeOpacity={1} onPress={this._onHearPress}>
                        <Image source={require('./../../assets/test/hear.jpeg')} style={searchStyles.searchHearImage} />
                    </TouchableOpacity>
                </View>
            </View>
        );
    }
}

const homeStyles = StyleSheet.create({
    container: {
        justifyContent: 'space-between'
    }
})

const searchStyles = StyleSheet.create({
    searchContainer: {
        flexDirection: 'row',
        justifyContent: 'space-between',
        alignItems: 'center',
        margin: 20
    },
    searchHear: {
        width: 60,
        height: 60,
        overflow: 'hidden',
        borderRadius: 50
    },
    searchHearImage: {
        width: 60,
        height: 60
    },
    searchContent: {
        height: 70,
        flex: 1,
        flexDirection: 'row',
        alignItems: 'center',
        backgroundColor: '#ededed',
        marginRight: 20,
        borderRadius: 10
    },
    searchImageContent: {
        width: 40,
        height: 40,
        marginLeft: 30,
        marginRight: 30
    },
    searchImage: {
        width: 40,
        height: 40
    },
    placeText: {
        fontSize: 26,
        fontWeight: '400',
        color: 'rgba(0, 0, 0, 0.5)'
    }
});

export default HomeScreen;